jQuery(function($) {
	loadData();
});

function loadData(){
	var data = $("#userQueryForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#context").html(data);
		}
	});
}

function seeDetail(trId, target){
	var detail = $("#"+trId);
	if(detail.is(':hidden')){
        $(target).html("关闭关联玩家");
        detail.show();
	}else{
        detail.hide();
        $(target).html("查看关联玩家");
	}
}

function addUser() {
	window.location.href = 'addUser';
}
function delUser(id) {
	if(confirm("确认删除此用户吗？")){
        $.ajax({
            type:"POST",
            url:"delUser",
            data:"id="+id,
            cache:false,
            dataType:"json",
            success:function(data){
                if(data.code == "1"){
                    window.location.href=ctx+"/admin/systemManager/userManager";
                }else {
                    alert("温馨提示：" + data.msg);
                }
            }
        });
	}
}